/* FlickrImport */

#import <Cocoa/Cocoa.h>
#import <ObjectiveFlickr/ObjectiveFlickr.h>
@class PreferenceController;
@class MEFlickrConnection;

@interface FlickrImport : NSObject
{
    IBOutlet NSText *Data;
    OFFlickrContext *context;
    OFFlickrInvocation *invoc;
    
    NSString *api_key;
    NSString *shared_secret;
    
    NSString *frob;
    NSString *token;
    
    PreferenceController *preferenceController;
    IBOutlet NSTableView *flickrUsers;
    IBOutlet NSTableView *flickrUserPhotos;
    IBOutlet NSImageView *flickrPhoto;
    IBOutlet NSText *flickrPhotoData;
    IBOutlet NSButton *importToiPhoto;
    
    NSMutableDictionary *flickrPhotoExif;
    NSMutableArray *flickrUserList;
    NSMutableArray *flickrPhotoSet;
}

- (IBAction) showPreferencePanel: (id) sender;
- (IBAction)importToiPhoto:(id)sender;

- (void) showPreferences;
- (void) updateUserDetails;

- (NSString *) frob;
- (NSString *) token;

- (void) handleErrors: (id)caller errorCode:(int)error data:(id)data;
- (void) handlePhotoData: (id)caller errorCode:(int)error data:(id)data;

- (void)flickrInvocation:(OFFlickrInvocation*)invocation didFetchData:(NSXMLDocument*)xmldoc;
- (void)flickrInvocation:(OFFlickrInvocation*)invocation errorCode:(int)errcode errorInfo:(id)errinfo;

- (void) getList: (NSXMLDocument*)xmldoc;

- (void) getExif: (NSXMLDocument*)xmldoc;

- (int) numberOfRowsInTableView: (NSTableView *) aTableView;
- (id) tableView: (NSTableView *) aTableView
            objectValueForTableColumn: (NSTableColumn *) aTableColumn
             row: (int) row;
- (void) tableViewSelectionDidChange: (NSNotification *) notification;
- (BOOL) createWritableDirectory:(NSString *)path;
- (NSString *) temporaryDirectory;
- (NSString *)temporaryDirectory;

@end
